Page({
  data: {
    // markers: [{
    //   // iconPath: "../images/icon/map.png",
    //   id: 0,
    //   latitude: 23.099994,
    //   longitude: 113.324520,
    //   width: 50,
    //   height: 50
    // }],
    markers:[],
    polyline:[],
    latitude: '',
    longitude: '',
    // polyline: [{
    //   points: [{
    //     longitude: 113.3245211,
    //     latitude: 23.10229
    //   }, {
    //     longitude: 113.324520,
    //     latitude: 23.21229
    //   }],
    //   color: "#FF0000DD",
    //   width: 2,
    //   dottedLine: true
    // }],
    controls: [{
      id: 1,
      iconPath: '../images/icon/map.png',
      position: {
        left: 0,
        top: 300 - 50,
        width: 50,
        height: 50
      },
      clickable: true
    }]
  },
  onLoad: function (options) {
    var longitude = options.longitude;
    var latitude = options.latitude;
    // console.log(longitude)
    // console.log(latitude)
    this.setData({
      markers: [{
        iconPath: "../images/icon/map1.png",
        id: 0,
        latitude: latitude,
        longitude: longitude,
        width: 40,
        height: 40
      }]
    });
    this.setData({
      latitude: latitude,
    })
    this.setData({
      longitude: longitude,
    })


    this.setData({
      polyline: [{
        points: [{
          longitude: longitude,
          latitude: latitude
        }, {
            longitude: longitude,
            latitude: latitude
        }],
        color: "#FF0000DD",
        width: 2,
        dottedLine: true
      }]
    })
  },
  regionchange(e) {
    console.log(e.type)
  },
  markertap(e) {
    console.log(e.markerId)
  },
  controltap(e) {
    console.log(e.controlId)
  }
})